import React, { Component } from 'react'
import  XzButton  from "./components/XzButton";
export default class App extends Component {
  state={
    showChild:false
  }
  showBtn=()=>{  
   this.setState({showChild:!this.state.showChild})
   console.log(this.state.showChild);
  }
  render() {
    return (
      <div>
        <h1>这是根组件</h1>
        <button onClick={this.showBtn}>挂载/卸载XzButton子组件</button>
        <hr/>
          {
            this.state.showChild && (<XzButton></XzButton>)
          }       
      </div>
    )
  }
}
